package com.jjw.route.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jjw.route.utils.PageUtils;
import com.jjw.route.utils.Query;

import com.jjw.route.dao.PtypeDao;
import com.jjw.route.entity.PtypeEntity;
import com.jjw.route.service.PtypeService;


@Service("ptypeService")
public class PtypeServiceImpl extends ServiceImpl<PtypeDao, PtypeEntity> implements PtypeService {
    @Autowired
    PtypeDao ptypeDao;
    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<PtypeEntity> page = this.page(
                new Query<PtypeEntity>().getPage(params),
                new QueryWrapper<PtypeEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<PtypeEntity> getAll(){
        return ptypeDao.selectList(new QueryWrapper<>());
    }
}